1. Field of the Technology
The present disclosure relates generally to computer devices having application programs which utilize “garbage collection” processes, and more particularly to concurrent execution of a garbage collection process during the execution of an application program.
2. Description of the Related Art
A computer device, such as a mobile communication device operating in a wireless communication network, may provide communications (e.g. voice telephony and data packet communications) for an end user. The device may further have an application program which is stored in its memory and executed by one or more processors (e.g. a microprocessor). The application program may help provide the device with user interface functionality, for example. The application program may be, for example, an e-mail application program which provides the end user with user interface functionality for reading and authoring e-mail messages from the device.
The application program may be written in any suitable programming language, such as JAVA® programming language. JAVA® is a registered trademark of Sun Microsystems, Inc. A JAVA virtual machine (JVM) is the component of JAVA technology that is responsible for independence between the hardware and operating system, the small size of compiled JAVA code, and the ability to protect users from malicious programs. The JVM is an abstract computing machine. Like a real computing machine, the JVM has an instruction set and manipulates various memory areas at run time.
A “heap” of the JVM stores all objects created by the JAVA application program. Objects are created by JAVA's new operator and memory space for new objects is allocated on the heap at run time. In general, a conventional “garbage collection” process is a JAVA process which automatically frees objects that are no longer referenced by an application program. When an object is no longer referenced by an application program, the heap space that the object occupies is effectively released or recycled so that the space can be made available for subsequently-produced objects. The garbage collector must determine which objects are no longer referenced by the application program and make available the heap space occupied by such unreferenced objects. There are many ways in which to implement garbage collection processes and such techniques are well-documented and publicly available.
The garbage collection process frees one from having to keep track of when to free allocated memory, which prevents many potential application bugs and hardships. However, garbage collection processes are processor-intensive and require that the application program be temporarily suspended. The garbage collection process may take a relatively long time to complete as well. This interferes with use of the device, especially when the need for communications by the end user may be critical.
Accordingly, what are needed are methods and apparatus for use in controlling garbage collection processes in computer devices such as mobile communication devices.